package db;

import java.sql.Connection;
import java.sql.DriverManager;

/* DB ?��?�� ?���?
 *  1. ?��?��?���? 로딩
 *   - Class.forName(?��?��?��브명)
 *  2. ?��결객�? ?��?��
 *   - Connection conn = DriverManager.getConnection(url,id,pwd)
 *  3. Statement ?��?��
 *   - Statement stmt = conn.createStatement()
 *   - PreparedStatement pstmt = conn.prepareStatement()
 *  4. SQL ?��?��
 *   - Select 문장 : pstmt.executeQuery()
 *   - Insert,Update,Delete : patmt.executeUpdate()*/
		
public class MySql {
	
	Connection conn; 
	
	public MySql(){
		String driver = "com.mysql.jdbc.Driver";
		String url = "jdbc:mysql://112.175.85.203:3306/semyadmin";
		String id = "semyadmin";
		String pwd = "Admin127.0.0.1";
		try{
			Class.forName(driver);
			conn = DriverManager.getConnection(url,id,pwd); 
		}
		catch(Exception ex){
			ex.printStackTrace();
		}
	}
	
	public Connection getConn(){
		return conn;
	
	} //getter ?��?��
	
	public static void main(String[]args){
		new MySql();
	}
}
